import React from 'react'
import { render } from 'react-dom'
import { BrowserRouter, Route, Switch, Redirect } from 'react-router-dom'

import { mainRoutes } from './routes/router'

import './App.css'
import App from './App'

render(<BrowserRouter>
    <Switch>
        <Route path="/disk" render={routeProps => <App {...routeProps} />} />
        {mainRoutes.map(route => {
            return <Route key={route.path}  {...route} />
        })}
        <Redirect path="/" to="/disk" />
        <Redirect to="/404" />
    </Switch>
</BrowserRouter>, document.getElementById('root'))